//
// Created by 11510 on 2024/6/21.
//
#include <iostream>
#include <string>
#include <memory>
#include <vector>
using namespace std;
class Point{
public:
    Point(int x, int y):x(x), y(y){
    }
    void print()const{
        printf("(%d, %d)\n", x, y);
    }
private:
    int x;
    int y;
};

void test0() {
    shared_ptr<Point> sp(new Point(8, 1));
    shared_ptr<Point> sp2(sp);
    (*sp).print();
    sp2->print();

    cout << sp.use_count() << endl;

}
void test1(){
    vector<shared_ptr<Point>> list;
    shared_ptr<Point> sp(new Point(8, 1));
    shared_ptr<Point> sp2(new Point(3, 5));
    list.push_back(sp);
    list.push_back(move(sp2));

    cout << sp.use_count() << endl;
    cout << sp2.use_count() << endl;
    cout << list[1].use_count() << endl;
}
int main() {
    test1();
    return 0;
}